package com.hhss.qishi.DPtest.designpattern.command;

/**
 * 电灯类
 */
public class Light {

    private boolean status;

    public Light(){
        status = false;
    }

    public void on(){
        if(!status){
            System.out.println("电灯亮了");
            status = true;
        }
    }

    public void off(){
        if (status){
            System.out.println("电灯灭了");
            status = false;
        }
    }

}
